<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="工单号">
        <el-input v-model="queryParams.fOrderNo" placeholder="请输入工单号" clearable style="width: 240px"
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="优先级">
        <el-select v-model="queryParams.fOrderPriority" clearable placeholder="请选择"
          @change="queryParams.pageNum = 1, getLists()">
          <el-option label="紧急" value="0"></el-option>
          <el-option label="高" value="1"></el-option>
          <el-option label="中" value="2"></el-option>
          <el-option label="低" value="3"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="添加日期">
        <el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
          range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="dateChange"></el-date-picker>
      </el-form-item><br>
      <el-form-item label="客户">
        <el-select v-loadmore="clientLoad" filterable clearable v-model="queryParams.fClientName" placeholder="请选择客户"
          @change="queryParams.pageNum = 1, getLists()">
          <el-option v-for="(item, index) in clientList" :key="index" :label="item.fClientCode"
            :value="item.fId"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="执行状态">
        <el-select v-model="queryParams.fRunState" clearable placeholder="请选择" style="width: 240px"
          @change="queryParams.pageNum = 1, getLists()">
          <el-option v-for="(item, index) in dict.type.wf_run_state" :key="index" :label="item.label"
            :value="item.value"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="工单类型">
        <el-select v-model="queryParams.fOrderType" clearable placeholder="请选择" style="width: 240px"
          @change="queryParams.pageNum = 1, getLists()">
          <el-option label="质检单" value="0"></el-option>
          <el-option label="波形调试" value="1"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-dropdown>
          <el-button size="mini" type="primary">
            新增<i class="el-icon-arrow-down el-icon--right"></i>
          </el-button>
          <el-dropdown-menu slot="dropdown">
            <el-button type="text" @click="showDialog1"
              style="font-size: 12px; padding: 8px 10px;">波形调试工单</el-button><br>
            <el-button type="text" @click="showDialog2" style="font-size: 12px; padding: 8px 20px;">质检工单</el-button>
          </el-dropdown-menu>
        </el-dropdown>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleaudit"
          v-hasPermi="['system:edit']">审核</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleaudits"
          v-hasPermi="['system:edit']">反审核</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['system:remove']">批量删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleCancel"
          v-hasPermi="['system:remove']">批量取消</el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center">
      </el-table-column>
      <el-table-column label="序号" align="center" prop="fId" />
      <el-table-column label="工单号" align="center" prop="fOrderNo" />
      <el-table-column label="工单名称" align="center" prop="fOrderName" />
      <el-table-column label="工单类型" align="center" prop="fOrderType">
        <template slot-scope="scope">
          <span>{{ scope.row.fOrderType === 0 ? '质检单' : '波形调试' }}</span>
        </template>
      </el-table-column>
      <el-table-column label="工厂名称" align="center" prop="bcmOrg.fOrgName">
      </el-table-column>
      <el-table-column label="设备名称" align="center" prop="wfDevice.fDeviceName" />
      <el-table-column label="客户" align="center" prop="bcmClient.fClientCode" />
      <el-table-column label="优先级" align="center" prop="fRunRate">
        <template slot-scope="scope">
          <span>{{
            scope.row.fOrderPriority === 0 ? '紧急' :
              scope.row.fOrderPriority === 1 ? '高' :
                scope.row.fOrderPriority === 2 ? '中' :
                  scope.row.fOrderPriority === 3 ? '低' :
                    ''
            }}</span>
        </template>
      </el-table-column>
      <el-table-column label="执行状态" align="center" prop="fRunState">
        <template slot-scope="scope">
          <span>{{
            scope.row.fRunState === 0 ? '待执行' :
              scope.row.fRunState === 1 ? '运行中' :
                scope.row.fRunState === 2 ? '已结束' :
                  scope.row.fRunState === 3 ? '已取消' :
                    scope.row.fRunState === 4 ? '未提交' :
                      scope.row.fRunState === 5 ? '待审核' :
                        scope.row.fRunState === 6 ? '已暂停' :
                          '' }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审批状态" align="center" prop="fDocumentStatus">
        <template slot-scope="scope">
          <span>{{
            scope.row.fDocumentStatus === 0 ? '保存' :
              scope.row.fDocumentStatus === 1 ? '提交' :
                scope.row.fDocumentStatus === 2 ? '审核' :
                  scope.row.fDocumentStatus === 3 ? '重新审核' :
                    '' }}</span>
        </template>
      </el-table-column>
      <el-table-column label="执行进度" align="center" prop="fRunRate">
        <template slot-scope="scope">
          <span>{{ scope.row.fRunRate ? scope.row.fRunRate + '%' : '' }}</span>
        </template>
      </el-table-column>
      <el-table-column label="开始时间" align="center" prop="fStartTime" min-width="180" />
      <el-table-column label="计时" align="center" prop="fTiming" min-width="180" />
      <el-table-column label="预计开始时间" align="center" prop="fExpectStartTime" min-width="180" />
      <el-table-column label="最快完成时间" align="center" prop="fExpectEndTime" min-width="180" />
      <el-table-column label="最晚完成时间" align="center" prop="fLatestEndTime" min-width="180" />
      <el-table-column label="交付日期" align="center" prop="fPayDate" min-width="150" />
      <el-table-column label="是否逾期" align="center" prop="fIsOverdue">
        <template slot-scope="scope">
          <span>{{ scope.row.fIsOverdue === 0 ? '否' : '是' }}</span>
        </template>
      </el-table-column>
      <el-table-column label="测试数量" align="center" prop="fTextNum" />
      <el-table-column label="负责人" align="center" prop="sysUser.nickName" />
      <el-table-column label="创建人" align="center" prop="fCreaterName" />
      <el-table-column label="修改人" align="center" prop="fModifierName" />
      <el-table-column label="创建时间" align="center" prop="fCreateDate" width="180">
      </el-table-column>
      <el-table-column fixed="right" label="操作" align="center" min-width="300" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleCheck(scope.row)"
            v-hasPermi="['system:role:edit']">查看</el-button>
          <el-button v-if="(scope.row.fRunState === 0 || scope.row.fRunState === 1) && scope.row.fDocumentStatus === 2"
            size="mini" type="text" icon="el-icon-edit" @click="handleSuspend(scope.row)"
            v-hasPermi="['system:edit']">暂停</el-button>
          <el-button v-if="scope.row.fRunState === 6 && scope.row.fDocumentStatus === 2" size="mini" type="text"
            icon="el-icon-edit" @click="handleStartup(scope.row)" v-hasPermi="['system:edit']">启动</el-button>
          <el-button
            v-if="scope.row.fRunState === 1 || scope.row.fRunState === 0 || scope.row.fRunState === 5 || scope.row.fRunState === 6"
            size="mini" type="text" icon="el-icon-edit" @click="handleCancel(scope.row)"
            v-hasPermi="['system:edit']">取消</el-button> <!-- 根据状态决定是否显示 -->
          <el-button v-if="scope.row.fRunState === 2" size="mini" type="text" icon="el-icon-edit"
            @click="handleRetest(scope.row)" v-hasPermi="['system:edit']">复测</el-button>
          <el-button
            v-if="(scope.row.fRunState === 0 || scope.row.fRunState === 1 || scope.row.fRunState === 6) && scope.row.fDocumentStatus === 2"
            size="mini" type="text" icon="el-icon-edit" @click="handleHandle(scope.row)"
            v-hasPermi="['system:edit']">强制执行</el-button>
          <el-button v-if="scope.row.fRunState === 4 || scope.row.fRunState === 3" size="mini" type="text"
            icon="el-icon-edit" @click="handleSubmit(scope.row)" v-hasPermi="['system:edit']">提交</el-button>
          <el-button v-if="(scope.row.fRunState === 4 || scope.row.fRunState === 3) && scope.row.fOrderRunNum === 1"
            size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
            v-hasPermi="['system:edit']">编辑</el-button>
          <el-button v-if="scope.row.fRunState === 4 || scope.row.fRunState === 3" size="mini" type="text"
            icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:remove']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getLists" />

    <waveForm ref="waveForm" @success="successOrders"></waveForm>
    <waveFormEdit ref="waveFormEdit" @success="successOrders"></waveFormEdit>
    <!-- 质检工单 -->
    <work-order ref="workOrder" @success="successOrder"></work-order>
    <work-order-edit ref="workOrderEdit" @success="successOrder" @close="getLists()"></work-order-edit>
    <el-dialog type="primary" :visible.sync="dialogeCi" width="60%" append-to-body>
      <el-form ref="ciObj" :model="ciObj" label-width="250" v-if="dialogeCi">
        <el-form-item label="复测模式选择">
          <el-radio-group v-model="ciObj.fRetestType" @change="ciObj.fRetestNgNum = ''">
            <el-radio :label="0" style="font-size: 12px; padding: 8px 10px;">复测一次工单</el-radio><br />
            <el-radio :label="1" size="medium" style="font-size: 12px; padding: 8px 10px;">只测NG任务
              <el-select v-model="ciObj.fRetestNgNum" placeholder="请选择" :disabled="ciObj.fRetestType === 0">
                <el-option v-for="(item, index) in ciList" :key="index" :label="'第' + item + '次测试'"
                  :value="item"></el-option>
              </el-select>
            </el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogeCi = false">取 消</el-button>
        <el-button type="primary" @click="ciConfirm">确 定</el-button>
      </div>
    </el-dialog>
    <!-- 期望LAB值范围 -->
  </div>
</template>

<script>
import { lisquality, getquality, delquality, addquality, updatequality, statequality, auditstatus, retestWork, resultng, mandatory } from "@/api/workOrder/zhidjianggd";
import { listClient } from "@/api/basicData/customer"
import WorkOrder from "./workOrder.vue";
import workOrderEdit from "./workOrderEdit.vue";
import waveForm from "./waveForm.vue";
import waveFormEdit from "./waveFormEdit.vue";
export default {
  name: "Post",
  dicts: ['sys_normal_disable', 'wf_run_state'],
  components: {
    WorkOrder,
    workOrderEdit,
    waveForm,
    waveFormEdit,
  },
  data() {
    return {
      dialogeCi: false,
      dialoge1: false,
      dialoge2: false,
      dialoge3: false,
      dialoge4: false,
      dialoge5: false,
      dialoge6: false,
      dialoge7: false,
      dialog1Visible: false,
      dialog2Visible: false,
      dateRange: '',
      tableData: [],
      dictType: true,
      value1: true,
      value2: true,
      value3: true,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 岗位表格数据
      postList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        fOrderNo: undefined,
        fOrderName: undefined,
        status: undefined,
      },
      // 表单参数
      form: {
        fOrderNo: undefined,
        fOrderName: undefined,
        fIds: []
      },
      // 表单校验
      rules: {
        postName: [
          { required: true, message: "岗位名称不能为空", trigger: "blur" }
        ],
        postCode: [
          { required: true, message: "岗位编码不能为空", trigger: "blur" }
        ],
        postSort: [
          { required: true, message: "岗位顺序不能为空", trigger: "blur" }
        ]
      },
      dialogWorkVisible: false,
      ciObj: {
        fOrderId: undefined,
        fOrderNo: undefined,
        fRetestType: 0,
        fRetestNgNum: ''
      },
      ciList: [],
      clientList: [],
      clientWhere: { pageNum: 1, pageSize: 20 },
    };
  },
  created() {
    this.getClient();
    this.getLists();
  },
  methods: {
    clientLoad() {
      this.clientWhere.pageNum += 1
      this.getClient()
    },
    getClient() {
      listClient(this.clientWhere).then(res => {
        this.clientList = [...this.clientList, ...res.rows]
      })
    },
    dateChange(e) {
      console.log(e)
      this.queryParams.fCreateDateStart = e[0]
      this.queryParams.fCreateDateEnd = e[1]
      this.getLists()
    },
    successOrder() {
      this.getLists()
    },
    successOrders() {
      this.getLists()
    },
    /** 查询岗位列表 */
    getLists() {
      this.loading = true;
      lisquality(this.addDateRange(this.queryParams)).then(response => {
        console.log(response, 'fffffffffffff');
        if (response && response.rows) {  // 增加对响应数据的判断
          this.postList = response.rows;
          this.postList.bcmOrg = response.rows;
          this.total = response.total;
        }
        this.loading = false;
      })
        .catch(error => {
          console.error('获取列表数据时出错:', error);
        });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        fId: undefined,
        postId: undefined,
        postCode: undefined,
        postName: undefined,
        postSort: 0,
        status: "0",
        remark: undefined
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getLists();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
      },
        this.dateRange = ''
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.fId)
      this.single = selection.length != 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */

    showDialog1() {
      console.log('点击了选项 1');
      this.$refs.waveForm.form = {
        fLogicalSettings: 0,
        fForbidStatus: 0,
        fOrderNo: '',
        fMesNo: '',
        fIsMes: false,
        fOrderPriority: '',
        fOrderName: '',
        fOrgId: '',
        fDeviceId: '',
        fClientName: '',
        fUserId: '',
        fProductId: '',
        fProductBatchNo: '',
        fTraySpecofocatopns: '',
        fPayDate: '',
        fRemark: '',
        fOrderType: 1,
        wfOrderTaskList: [],
        wfPlanDetailList: [],
        wfPlanDetailLists: [],
        wfVsSettingList: []
      }
      this.$refs.waveForm.product = {}
      this.$refs.waveForm.form.check = 0;
      this.$refs.waveForm.open();
    },
    //质检新增
    showDialog2() {
      console.log('点击了选项 2');
      // this.dialog2Visible = true;
      this.$refs.workOrder.form = {
        fForbidStatus: 0,
        fOrderNo: '',
        fMesNo: '',
        fIsMes: false,
        fOrderPriority: '',
        fOrderName: '',
        fOrgId: '',
        fDeviceId: '',
        fClientName: '',
        fUserId: '',
        fProductId: '',
        fProductBatchNo: '',
        fTraySpecofocatopns: '',
        fPayDate: '',
        fRemark: '',
        fOrderType: 0,
        wfOrderTaskList: []
      }
      this.$refs.workOrder.product = {}
      this.$refs.workOrder.form.check = 0;
      this.$refs.workOrder.open();
    },
    /** 波形工单新增 */
    showBialog1() {
      console.log('点击了选项 1');
      this.dialoge1 = true;
    },
    showBialog2() {
      console.log('点击了选项 2');
      this.dialoge2 = true;
    },
    showBialog3() {
      console.log('点击了选项 3');
      this.dialoge3 = true;
    },
    //波形工单逻辑设计
    showBialog4() {
      console.log('点击了选项 3');
      this.dialoge4 = true;
    },
    /** 质检工单新增 */
    showcialog5() {
      console.log('点击了选项 4');
      this.dialoge5 = true;
    },
    showcialog6() {
      console.log('点击了选项 5');
      this.dialoge6 = true;
    },
    showcialog7() {
      console.log('点击了选项 5');
      this.dialoge7 = true;
    },
    showcialog8() {
      console.log('点击了选项 5');
      this.dialoge8 = true;
    },
    //暂停
    handleSuspend(row) {
      let data = {
        'fIds': [row.fId] || this.ids,
        'fRunState': 6 // 更新状态为暂停
      }
      statequality(data).then(response => {
        // 假设响应中包含更新后的状态信息
        this.getLists();
        this.$message.success('暂停成功');  // 显示成功消息
      }).catch(error => {
        console.error('暂停操作出错:', error);
        this.$message.error('暂停失败，请稍后重试');  // 显示失败消息
      });
    },
    //启动
    handleStartup(row) {

      let data = {
        'fIds': [row.fId] || this.ids,
        'fRunState': 1 // 更新状态为启动中
      }
      statequality(data).then(response => {
        this.getLists();
        this.$message.success('启动成功');
      })
        .catch(error => {
          console.error(error);
          this.$message.error('启动失败，请稍后重试');
        });
    },
    //取消
    handleCancel(row) {
      const fIds = (row.fId ? [row.fId] : this.ids)
      const data = {
        'fIds': fIds,
        'fRunState': 3, // 更新状态为已取消
      }
      console.log(data, "1111111");
      statequality(data).then(response => {
        this.getLists();
        this.$message.success('取消成功');
      })
    },
    handleRetest(row) {
      this.ciObj.fOrderId = row.fId
      this.ciObj.fOrderNo = row.fOrderNo
      resultng(row.fId).then(res => {
        this.ciList = res.data
        this.dialogeCi = true
      })
    },
    ciConfirm() {
      retestWork(this.ciObj).then(response => {
        this.dialogeCi = false
        this.getLists()
        this.$message.success(response.msg);
      })
    },
    //强制执行
    handleHandle(row) {
      const data = {
        'fIds': [row.fId] || this.ids
      }
      mandatory(data)
        .then(response => {
          row.fRunState = response;
          this.getLists();
          this.$message.success('操作成功');
        })
        .catch(error => {
          console.error(error);
          this.$message.error('取消失败，请稍后重试');
        });
    },
    //提交
    handleSubmit(row) {
      const data = {
        'fIds': [row.fId] || this.ids,
        'fRunState': 5
      }
      // 假设提交对应状态值为 5
      statequality(data)
        .then(response => {
          this.getLists();
          this.$message.success('提交成功');
        })
        .catch(error => {
          console.error(error);
          this.$message.error('提交失败，请稍后重试');
        });
    },
    //审核
    handleaudit() {
      const data = {
        'fId': this.ids[0],
        'fDocumentStatus': 2
      }
      auditstatus(data)
        .then(response => {
          this.getLists();
          this.$message.success('提交成功');
        })
        .catch(error => {
          console.error(error);
          //this.$message.error('提交失败，请稍后重试');
        });
    },
    //反审核是
    handleaudits() {
      const data = {
        'fId': this.ids[0],
        'fDocumentStatus': 3
      }
      auditstatus(data)
        .then(response => {
          this.getLists();
          this.$message.success('提交成功');
        })
        .catch(error => {
          console.error(error);
          //this.$message.error('提交失败，请稍后重试');
        });
    },
    // 编辑
    handleUpdate(row) {
      console.log(row, "row");
      getquality(row.fId).then(res => {
        if (row.fOrderType === 0) {
          // 质检工单编辑逻辑
          this.$refs.workOrderEdit.open();
          this.$refs.workOrderEdit.product = res.data.bcmProduct;
          this.$refs.workOrderEdit.form = res.data;
          this.$refs.workOrderEdit.form.wfOrderTaskList = res.data.wfOrderTaskList;
          this.$refs.workOrderEdit.form.check = 0;
        } else if (row.fOrderType === 1) {
          this.$refs.waveFormEdit.open();
          this.$refs.waveFormEdit.product = res.data.bcmProduct;
          this.$refs.waveFormEdit.form = res.data;
          this.$refs.waveFormEdit.form.wfOrderTaskList = res.data.wfOrderTaskList;
          this.$refs.waveFormEdit.form.check = 0;
          this.$refs.waveFormEdit.form.wfPlanDetailList = []
          this.$refs.waveFormEdit.form.wfPlanDetailLists = []
          if(res.data.fVsRSetting==1||res.data.fVsWSetting==1){
            res.data.wfVsSettingList.forEach(element => {
              console.log('asdasdsadasd',element.fVsType)
              if(element.fVsType == 0){
                this.$refs.waveFormEdit.form.wfPlanDetailList.push(element)
              }
              if(element.fVsType == 1){
                this.$refs.waveFormEdit.form.wfPlanDetailLists.push(element)
              }
            });
          }
        }
      });
    },
    // 查看设备操作
    handleCheck(row) {
      getquality(row.fId).then(res => {
        if (row.fOrderType === 0) {
          // 质检工单查看逻辑
          this.$refs.workOrderEdit.open();
          this.$refs.workOrderEdit.form = res.data;
          this.$refs.workOrderEdit.product = res.data.bcmProduct;
          this.$refs.workOrderEdit.form.check = 1;
          this.$refs.workOrderEdit.form.wfOrderTaskList = res.data.wfOrderTaskList;
        } else if (row.fOrderType === 1) {
          this.$refs.waveFormEdit.open();
          this.$refs.waveFormEdit.form = res.data;
          this.$refs.waveFormEdit.product = res.data.bcmProduct;
          this.$refs.waveFormEdit.form.check = 1;
          this.$refs.workOrderEdit.form.wfOrderTaskList = res.data.wfOrderTaskList;

          this.$refs.waveFormEdit.form.wfPlanDetailList = []
          this.$refs.waveFormEdit.form.wfPlanDetailLists = []
          if(res.data.fVsRSetting==1||res.data.fVsWSetting==1){
            res.data.wfVsSettingList.forEach(element => {
              console.log('asdasdsadasd',element.fVsType)
              if(element.fVsType == 0){
                this.$refs.waveFormEdit.form.wfPlanDetailList.push(element)
              }
              if(element.fVsType == 1){
                this.$refs.waveFormEdit.form.wfPlanDetailLists.push(element)
              }
            });
          }
        }
      });
    },
    /** 提交按钮 */
    submitForm: function () {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.fId != undefined) {
            updatequality(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getLists();
            });
          } else {
            addquality(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getLists();
            });
          }
        }
      });
    },
    /** 删除产品操作 */
    handleDelete(row) {
      const userIds = row.fId || this.ids;
      this.$modal.confirm('是否确认删除工单号为"' + userIds + '"的数据项？').then(function () {
        return delquality(userIds);
      }).then(() => {
        this.getLists();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
  }

};
</script>
